import React,{Component} from "react";
import {Tabs,NavBar} from 'antd-mobile';
const TabPane = Tabs.TabPane;
import './style.css';
import ActivityList from './activity/index.js'
import CouponList from './coupon/index.js'
import ShopList from './shop/index.js'
export default class AppShop extends Component{
    state={
        tabId:"1"
    }
    tabChange=(key)=>{
        this.setState({
            tabId:key
        })
    }
    render(){
        const tabId=this.state.tabId;
        return(
            <div>
                <NavBar
                        className="top-nav-bar"
                        iconName={false}
                    >彭州GO</NavBar>
                <Tabs defaultActiveKey={tabId} animated={false} className="main-shop-tabs"  onChange={this.tabChange}>
                    <TabPane tab="店铺活动" key="1">
                        {tabId==1?<ActivityList/>:null}
                    </TabPane>
                    <TabPane tab="优惠券" key="2">
                        {tabId==2?<CouponList/>:null}
                    </TabPane>
                    <TabPane tab="店铺" key="3">
                        {tabId==3?<ShopList/>:null}
                    </TabPane>
                </Tabs>
            </div>
        )
    }
}
